package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 商品次卡管理，记录次卡的基础信息、销售规则、使用限制及会员权益对象 product_pass_card_management
 *
 * @author ruoyi
 * @date 2025-05-22
 */
public class ProductPassCardManagement extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增主键ID，唯一标识每张次卡记录 */
    private Long id;

    /** 商品次卡名称（如“健身周卡”“游泳10次卡”） */
    @Excel(name = "商品次卡名称", readConverterExp = "如=“健身周卡”“游泳10次卡”")
    private String cardName;

    /** 商品次卡编号（唯一标识，如PC20230001） */
    @Excel(name = "商品次卡编号", readConverterExp = "唯=一标识，如PC20230001")
    private String cardCode;

    /** 可用次数（如10次、30次） */
    @Excel(name = "可用次数", readConverterExp = "如=10次、30次")
    private Integer availableTimes;

    /** 售价（单位：元，如199.00） */
    @Excel(name = "售价", readConverterExp = "单=位：元，如199.00")
    private BigDecimal salePrice;

    /** 原价（单位：元，如原价399.00，用于展示折扣力度） */
    @Excel(name = "原价", readConverterExp = "单=位：元，如原价399.00，用于展示折扣力度")
    private BigDecimal originalPrice;

    /** 状态：待上架（pending）、已上架（active）、已下架（inactive） */
    @Excel(name = "状态：待上架", readConverterExp = "p=ending")
    private String status;

    /** 卡面设置（JSON格式，示例：{"color":"#FF5733","custom_image_url":"https://example.com/card.png"}） */
    @Excel(name = "卡面设置", readConverterExp = "J=SON格式")
    private String cardFaceDesign;

    /** 购买限制（JSON格式，示例：{"online_purchase":true,"points_exchange":true}） */
    @Excel(name = "购买限制", readConverterExp = "J=SON格式")
    private String purchaseRestriction;

    /** 参与积分：不赠送（no_points）、赠送积分（grant_points） */
    @Excel(name = "参与积分：不赠送", readConverterExp = "n=o_points")
    private String pointsRewardPolicy;

    /** 赠送积分值（当points_reward_policy为grant_points时生效） */
    @Excel(name = "赠送积分值", readConverterExp = "当=points_reward_policy为grant_points时生效")
    private Integer pointsRewardValue;

    /** 使用日期限制（JSON格式，示例：{"restriction_type":"unlimited"}或{"restriction_type":"weekly","available_days":["MON","WED","FRI"]}或{"restriction_type":"custom","date_ranges":[{"start_date":"2023-10-01","end_date":"2023-10-31"}]}） */
    @Excel(name = "使用日期限制", readConverterExp = "J=SON格式")
    private String usageDateRestriction;

    /** 使用时间限制（JSON格式，示例：[{"start_time":"09:00","end_time":"21:00"}]） */
    @Excel(name = "使用时间限制", readConverterExp = "J=SON格式")
    private String usageTimeRestriction;

    /** 有效期类型：无限期（unlimited）、按天数（by_days）、按固定日期（by_fixed_date） */
    @Excel(name = "有效期类型：无限期", readConverterExp = "u=nlimited")
    private String validityType;

    /** 按天数有效期（当validity_type为by_days时生效，单位：天） */
    @Excel(name = "按天数有效期", readConverterExp = "当=validity_type为by_days时生效，单位：天")
    private Integer validityDays;

    /** 固定有效期截止日期（当validity_type为by_fixed_date时生效） */
    @Excel(name = "固定有效期截止日期", readConverterExp = "当=validity_type为by_fixed_date时生效")
    private Date fixedExpiryDate;

    /** 是否参与会员折扣（1=是，0=否） */
    @Excel(name = "是否参与会员折扣", readConverterExp = "1==是，0=否")
    private Integer memberDiscountEligible;

    /** 手机号 */
    @Excel(name = "手机号")
    private String phone;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setCardName(String cardName)
    {
        this.cardName = cardName;
    }

    public String getCardName()
    {
        return cardName;
    }

    public void setCardCode(String cardCode)
    {
        this.cardCode = cardCode;
    }

    public String getCardCode()
    {
        return cardCode;
    }

    public void setAvailableTimes(Integer availableTimes)
    {
        this.availableTimes = availableTimes;
    }

    public Integer getAvailableTimes()
    {
        return availableTimes;
    }

    public void setSalePrice(BigDecimal salePrice)
    {
        this.salePrice = salePrice;
    }

    public BigDecimal getSalePrice()
    {
        return salePrice;
    }

    public void setOriginalPrice(BigDecimal originalPrice)
    {
        this.originalPrice = originalPrice;
    }

    public BigDecimal getOriginalPrice()
    {
        return originalPrice;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setCardFaceDesign(String cardFaceDesign)
    {
        this.cardFaceDesign = cardFaceDesign;
    }

    public String getCardFaceDesign()
    {
        return cardFaceDesign;
    }

    public void setPurchaseRestriction(String purchaseRestriction)
    {
        this.purchaseRestriction = purchaseRestriction;
    }

    public String getPurchaseRestriction()
    {
        return purchaseRestriction;
    }

    public void setPointsRewardPolicy(String pointsRewardPolicy)
    {
        this.pointsRewardPolicy = pointsRewardPolicy;
    }

    public String getPointsRewardPolicy()
    {
        return pointsRewardPolicy;
    }

    public void setPointsRewardValue(Integer pointsRewardValue)
    {
        this.pointsRewardValue = pointsRewardValue;
    }

    public Integer getPointsRewardValue()
    {
        return pointsRewardValue;
    }

    public void setUsageDateRestriction(String usageDateRestriction)
    {
        this.usageDateRestriction = usageDateRestriction;
    }

    public String getUsageDateRestriction()
    {
        return usageDateRestriction;
    }

    public void setUsageTimeRestriction(String usageTimeRestriction)
    {
        this.usageTimeRestriction = usageTimeRestriction;
    }

    public String getUsageTimeRestriction()
    {
        return usageTimeRestriction;
    }

    public void setValidityType(String validityType)
    {
        this.validityType = validityType;
    }

    public String getValidityType()
    {
        return validityType;
    }

    public void setValidityDays(Integer validityDays)
    {
        this.validityDays = validityDays;
    }

    public Integer getValidityDays()
    {
        return validityDays;
    }

    public void setFixedExpiryDate(Date fixedExpiryDate)
    {
        this.fixedExpiryDate = fixedExpiryDate;
    }

    public Date getFixedExpiryDate()
    {
        return fixedExpiryDate;
    }

    public void setMemberDiscountEligible(Integer memberDiscountEligible)
    {
        this.memberDiscountEligible = memberDiscountEligible;
    }

    public Integer getMemberDiscountEligible()
    {
        return memberDiscountEligible;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String getPhone()
    {
        return phone;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("cardName", getCardName())
                .append("cardCode", getCardCode())
                .append("availableTimes", getAvailableTimes())
                .append("salePrice", getSalePrice())
                .append("originalPrice", getOriginalPrice())
                .append("status", getStatus())
                .append("cardFaceDesign", getCardFaceDesign())
                .append("purchaseRestriction", getPurchaseRestriction())
                .append("pointsRewardPolicy", getPointsRewardPolicy())
                .append("pointsRewardValue", getPointsRewardValue())
                .append("usageDateRestriction", getUsageDateRestriction())
                .append("usageTimeRestriction", getUsageTimeRestriction())
                .append("validityType", getValidityType())
                .append("validityDays", getValidityDays())
                .append("fixedExpiryDate", getFixedExpiryDate())
                .append("memberDiscountEligible", getMemberDiscountEligible())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("phone", getPhone())
                .toString();
    }
}
